// JORGE FERNANDO GOMEZ
// 1259371
// 189631
// LEC A1
// MARTIN MÜLLER
// D02
// YANG LIU


#ifndef DRAW1B_H
#define DRAW1B_H 1

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#define MAXLEN          256     /* Maximum characters in a string. */
#define MAXLEN_FIG      128     /* Maximum characters in figure name. */
#define MAXFIGS         16      /* Maximum number of Figures. */
#define MAX_SEGMENTS    16      /* Maximum number of draws per Figur. */


/* Struct to store lines from an input file
 * and their type. */
typedef struct {

    char lineString[MAXLEN+1];

    int commandType;
    enum { FIGURE, DRAW, END, PRINTFIGURE,
           DRAWFIGURE, TRANSLATE, CHILD, COMMENT
    } enumKeywords;

} Line;

/* Struct to store figure names, and each
 * figure's properties. */
typedef struct {
    char figureName[MAXLEN_FIG+1];
    int drawCount;
    double x, y;
    double dx[MAX_SEGMENTS], dy[MAX_SEGMENTS];
    int isdefined;
} Figure;


/* Keeps track of the amount of figures defined. */
extern int figureCount;

/* Line count of an input file. */
extern int inputFileLength;


/* Prototypes for popen() and pclose() */
FILE * popen (const char *, const char *);
int pclose (FILE *);

#endif /* end of include guard: DRAW1B_H */
